import {
  URL_ADDR
} from '@/config/env.js'

export default (url, data = {}, method = 'GET') => {
  return new Promise((resolve, reject) => {
    uni.request({
        url: URL_ADDR + url,
        data,
        method,
        success: res => {
          resolve(res)
        },
        fail: err => {
          reject(err)
        }
    })
  })
}